import React from "react";
import { Route } from "react-router-dom";

export default function Index({ routes }) {
  return (
    <div>
      {routes.map((item, index) => {
        return <Route
            path={item.path}
            render={() => {
              let Com = item.component;
              return <Com children={item.children} />;
            }}
            key={index}/>  
      })
      }
    </div>
  )
}
